-
Notifications
You must be signed in to change notification settings - Fork 520
[debug] Misc debug fixes #632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Set MCONTROL_S and/or MCONTROL_U bits only if the hart supports S-mode and/or U-mode. Signed-off-by: Hiroo HAYASHI <[email protected]>
TranslateTest depends on the S extension being supported. Without this change, the test fails on targets that do not support S extension. Signed-off-by: Hiroo HAYASHI <[email protected]>
…a instruction cf. riscv-software-src#537 Signed-off-by: Hiroo HAYASHI <[email protected]>
The default size argument of set_pmp_deny() is 4KB. However, bad_address in spike32.py and spike64.py assumes that the size is less than or equal to 8 bytes. 8 bytes is enough for each test calling set_pmp_deny(). So, set the size argument of set_pmp_deny() to 8 explicitly. Signed-off-by: Hiroo HAYASHI <[email protected]>
This is for the dmode bit in tdata1. Signed-off-by: Hiroo HAYASHI <[email protected]>
This suppresses warnings like: Warning: Command 'gdb_port' is deprecated, please use 'gdb port' instead. Warning: Command 'tcl_port' is deprecated, please use 'tcl port' instead. Warning: Command 'telnet_port' is deprecated, please use 'telnet port' instead. from debug/README.md: > openocd ..., which should be the latest from https://github.com/riscv/riscv-openocd.git. Signed-off-by: Hiroo HAYASHI <[email protected]>
This change makes debug/testlib.py not throw an exception when an expected error occurs while creating the logs/ directory. Fixing this is useful when debugging with python debugger not to break at the exception every time. Signed-off-by: Hiroo HAYASHI <[email protected]>
U500Sim.py is the only example of a target that uses VcsSim class. It does not work without this fix. Signed-off-by: Hiroo HAYASHI <[email protected]>
example: for https://github.com/fjullien/jtag_vpi/blob/master/jtag_common.c#L80 def create(self): return testlib.VcsSim(..., server_stared="^Starting jtag_vpi server:.*, port (\d+)/tcp") Signed-off-by: Hiroo HAYASHI <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fixes!
I have a few concerns. Please, take a look.
| print(name) | ||
| return 0 | ||
|
|
||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this try/except is no longer needed. Perhaps it can be removed?
| bad_address = self.hart.bad_address or 0 | ||
| if self.target.support_set_pmp_deny: | ||
| self.set_pmp_deny(bad_address) | ||
| self.set_pmp_deny(bad_address, 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid this will break the targets with insufficient PMP granularity (see [3.7.1.1. Address Matching] of the Priv Spec).
One way to address this is to:
- Introduce PMP granularity as a target parameter.
- Check the specified granularity using the algorithm from the spec.
- Use a supported size here.
Perhaps there is a better way to address the issue. In any case this needs to be addressed.
This PR includes several minor fixes for the debug tests.
See the commit log for details of each commit.
Thank you for these great test suites!